//
//  CustomLoadView.m
//  SinOpecHR
//
//  Created by Deng Chaozhong on 15/9/14.
//  Copyright (c) 2015年 Siloon.KevinW. All rights reserved.
//

#import "CustomLoadView.h"

@implementation CustomLoadView

- (id)initWithFrame:(CGRect)frame text:(NSString *)text
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setBackgroundColor:[UIColor blackColor]];
        [self setAlpha:0.6];
        
        
        UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width/2-120, self.frame.size.height/2-30, 240, 60)];
        backView.backgroundColor = [UIColor whiteColor];
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 30-25, 200, 50)];
        label.text = text;
        label.textColor = [UIColor blackColor];
        [backView addSubview:label];
        
        UIActivityIndicatorView *aiView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(10, 15, 30.0, 30.0)];
        
        aiView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
        
        [backView addSubview:aiView];
        
        [aiView startAnimating];
        [self addSubview:backView];
        return  self;
    }
    
    
    return nil;
    
}

@end
